<%@ page language="java" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<link rel="stylesheet" type="text/css" href="<%=path %>/js/jquery/easyui.css">
		<link rel="stylesheet" type="text/css" href="<%=path %>/js/jquery/icon.css">
		<link rel="stylesheet" type="text/css" href="<%=path %>/js/jquery/demo.css">
		<script type="text/javascript" src="<%=path %>/js/jquery/jquery-1.6.min.js"></script>
		<script type="text/javascript" src="<%=path %>/js/jquery/jquery.easyui.min.js"></script>
		<script>
		$(function(){
			loadGrid();
		});
		
		function loadGrid() {
			$('#wordlist').datagrid({
				title:'文档列表',
				iconCls:'icon-save',
				width:'auto',
				height:300,
				singleSelect: true,
				url:'datagrid_data.json',
				// loadMsg:'数据加载中请稍后……',
				columns:[[
			        {title:'文档名称',field:'name', align:'center', width:getWidth(0.94)}
				]],
				rownumbers:true
			});
			var p = $('#wordlist').datagrid('getPager');
			$(p).pagination({
				onBeforeRefresh:function(){
					alert('before refresh');
				}
			});
		}
		
		function getWidth(percent){ 
			return document.body.clientWidth*percent;
		} 
		
		function showwin() {
			parent.addTab('查看文档', '<%=path %>/servlet/MimeServlet');
		}
	</script>
</head>
<body>
	<table id="wordlist"></table>
</body>
</html>